{extend name='main'}

{block name="button"}

{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加班级" class='layui-btn layui-btn-sm layui-btn-primary'>添加班级</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-confirm="确定要删除选定班级吗？" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除班级</button>
{/if}
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='memberclass/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>班级</th>
            <th class='text-left nowrap'>学员数量</th>
            <th class='text-left nowrap'>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class="text-left nowrap">
                <span class="font-w7">{$vo.id|default='-'}</span>
            </td>
            <td class='text-left nowrap'>
                {$vo.name|default='-'}
            </td>
            <td class='text-left nowrap'>
                {$vo.snum|default='-'}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime}
            </td>
            <td class='text-left nowrap'>
                {if auth("edit")}
                <a class="layui-btn layui-btn-sm" data-title="编辑班级" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该班级吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
        {/notempty}
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
